load("//:build_variables.bzl", "COPTS")
load("//tools/lint:linters.bzl", "clang_tidy_test")

package(
    default_visibility = ["//:android_cuttlefish"],
)

exports_files([".clang-tidy"])

cc_binary(
    name = "kernel_log_monitor",
    srcs = [
        "main.cc",
    ],
    copts = COPTS,
    deps = [
        ":kernel_log_monitor_utils",
        "//cuttlefish/common/libs/fs",
        "//cuttlefish/common/libs/utils:result",
        "//cuttlefish/host/libs/config:cuttlefish_config",
        "//cuttlefish/host/libs/config:logging",
        "//libbase",
        "@gflags",
        "@jsoncpp",
    ],
)

clang_tidy_test(
    name = "kernel_log_monitor_clang_tidy",
    srcs = [":kernel_log_monitor"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "kernel_log_monitor_utils",
    hdrs = [
        "kernel_log_server.h",
        "utils.h",
    ],
    srcs = [
        "kernel_log_server.cc",
        "utils.cc",
    ],
    copts = COPTS,
    strip_include_prefix = "//cuttlefish",
    deps = [
        "//cuttlefish/common/libs/fs",
        "//cuttlefish/common/libs/utils:json",
        "//cuttlefish/common/libs/utils:result",
        "//cuttlefish/host/libs/config:config_constants",
        "//cuttlefish/host/libs/config:cuttlefish_config",
        "//libbase",
        "@jsoncpp",
    ],
)

clang_tidy_test(
    name = "kernel_log_monitor_utils_clang_tidy",
    srcs = [":kernel_log_monitor_utils"],
    tags = ["clang_tidy", "clang-tidy"],
)
